#include "mainscene.h"
#include "ui_mainscene.h"

MainScene::MainScene(QWidget *parent) :
    QMainWindow(parent),
    ui(new Ui::MainScene)
{
    ui->setupUi(this);

    //设置窗口
    //固定尺寸
    this->setFixedSize(mainSceneWidth,mainSceneHeight);
    //标题
    this->setWindowTitle(mainSceneName);
    //图标
    this->setWindowIcon(QIcon(":/res/Coin0001.png"));
}

MainScene::~MainScene()
{
    delete ui;
}

void MainScene::paintEvent(QPaintEvent *)
{
    QPainter painter(this);
    QPixmap pix;
    pix.load(":/res/bfda0be809541c57e1407952d1e6042.jpg");
    painter.drawPixmap(0,0,this->width(),this->height(),pix);

    //标题
    pix.load(":/res/Title.png");
    painter.drawPixmap((this->width()-pix.width())*0.5,30,pix);
}
